/**
 * 
 */
package cn.com.xf.service;

import java.util.List;

import cn.com.xf.domain.TblCheckCmd;
import cn.com.xf.domain.TblCheckDevice;
import cn.com.xf.domain.TblCheckLeave;
import cn.com.xf.domain.TblOaAuthPermission;
import cn.com.xf.domain.TblOaAuthRole;
import cn.com.xf.domain.TsUser;
import cn.com.xf.web.form.LeaveForm;
import cn.com.xf.web.form.SettingForm;

/**
 * @author Administrator
 * 
 */
public interface SettingService {
	/*
	 * public List<AuthRole> selectRoleList();
	 * 
	 * public List<AuthPermission> selectRolePermissonListByRoleId(Long roleId);
	 */

	public List<TblOaAuthRole> selectRoleList();

	public List<TblOaAuthRole> selectRoleList4Check(String siteId);

	public int insertUser(SettingForm form);

	public int updateUser(SettingForm form);

	public int updateUser4Check(LeaveForm form);

	public List<TsUser> selectUserList(String orderByField, String orderByMode, String userId, String userName,
			String siteId, String deptId, String enabled, String createDateBegin, String createDateEnd, int begin,
			int pageSize);

	public int selectUserListCount(String userId, String userName, String siteId, String deptId, String enabled,
			String createDateBegin, String createDateEnd);

	public int deleteUserByUserId(String userId);

	public TsUser selectByUserId(String userId);

	public TsUser selectUserWithRoleByUserId(String userId);

	public List<TblOaAuthPermission> selectAllPremission();

	public List<TblOaAuthPermission> selectAllPremission4Check();

	/**
	 * 添加角色
	 * 
	 * @param form
	 * @return
	 */
	public int insertRole(SettingForm form);

	public int insertRole4Check(LeaveForm form);

	/**
	 * 按照角色的中文名称查找角色
	 * 
	 * @param roleDesc
	 * @return
	 */
	public TblOaAuthRole selectRoleByDesc(String roleDesc);

	public TblOaAuthRole selectRoleByDescAndSiteId(String roleDesc, String siteId);

	/**
	 * 查找角色
	 * 
	 * @param orderByField
	 * @param orderByMode
	 * @param roleDesc
	 * @param begin
	 * @param pageSize
	 * @return
	 */
	public List<TblOaAuthRole> selectRoleList(String orderByField, String orderByMode, String roleDesc, int begin,
			int pageSize);

	public int selectRoleListCount(String roleDesc);

	/**
	 * 删除角色
	 * 
	 * @param roleId
	 * @return
	 */
	public int deleteRoleByRoleId(String roleId);

	public TblOaAuthRole selectRoleByRoleId(String roleId);

	/**
	 * 修改角色
	 * 
	 * @param roleId
	 * @param roleDesc
	 * @param permissions
	 * @return
	 */
	public int updateRole(String roleId, String roleDesc, String permissions);

	public int updateRole4Check(String roleId, String roleDesc, String permissions, String siteId);

	/**
	 * 检测该用户是否存在，如果不存在则增加，且增加权限
	 * 
	 * @param username
	 * @return
	 */
	public int insertByCheck(String username);
	
	public int insertDevice(TblCheckDevice device);
	
	public List<TblCheckDevice> selectDevice(List<String> siteList);
	
	List<TblCheckDevice> selectDevices(int begin, int pageSize, String siteid, String sn, String status);
	
	int selectDeviceCount(String siteid, String sn, String status);

	int deleteDevice(Long id);
	
	int insertCmds(List<TblCheckCmd> cmds);
	
	int insertCmd(TblCheckCmd cmd);
}
